<?php
(isset($nodes_count)) ? $total_row = $nodes_count : $total_row = 37;
(isset($more_url)) ? $url = $more_url : $url = 'pages/home/more';
(isset($termpage)) ? $uri_segment = 5 : $uri_segment = 4;
(isset($attr)) ? $classes = $attr : $classes = '';
$config['base_url'] = base_url() . $url;
$config['total_rows'] = $total_row;
$config['per_page'] = 10;
$config['uri_segment'] = $uri_segment;
$config['full_tag_open'] = '<div class="page-pagination">';
$config['full_tag_close'] = '</div>';
$this->pagination->initialize($config);
?>

<div class="row <?php echo $classes; ?>">

  <div class="nodes">
    <?php
    foreach($nodes as $key=>$node) {
      $node = $node[0];
      $this->load->view('nodes/nodeteaser',$node);
    }
    ?>
  </div>

  <?php
  if ($nodes_count > $config['per_page'] && $classes != 'front') {
    $pagination = $this->pagination->create_links();
    print $pagination;
  }
  ?>

  <?php if($classes == 'front'): ?>
  <div id="ajax-loading"><?php echo img('assets/img/load_more.png'); ?></div>
  <?php endif; ?>

</div>